App({
 globalData: {
  // 购物车全局数据
  shopping: [],
  // 购物车内商品的数量
  productsNum: 0,
 },
 getProductsNum() {
  console.log(this.globalData.shopping);
  let res = this.globalData.shopping.reduce((a, b) => {
   return Number(a) + Number(b.qty)
  }, 0)
  this.globalData.productsNum = res
 },
 onLaunch() {
  wx.getSetting({
   success: (res) => {
    // console.log(res);
   }
  }),
   wx.getUserInfo({
    lang: "zh_CN",
    success: (res) => {
     // console.log(res);
    }
   })
 }


}

)
